<?php
Yii::import ( 'model.QuickNote' );
Yii::import ( 'model.UserInfo' );
class QuickNoteWidget extends CWidget {
	public function run() {
		$userId = $_SESSION ['uid'];
		$userInfo = UserInfo::getInstance ()->getUserInfo ( $userId );
		if (! $userInfo ['show_quicknote']) {
			return;
		}
		$note = QuickNote::getInstance ()->getQuickNoteRandom();
		$note_content = $note ['note_content'];
		echo "<div class=\"alert alert-info\">
	   		<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>$note_content</div>";
	}
}

